<template>
  <div>
    <MyHeader title="购物车案例" backgroundColor="blue" color="black"></MyHeader>
    <div class="main">
        <MyGoods v-for="obj in list" :key="obj.id" :obj="obj"></MyGoods> 
    </div>
    <MyFooter :arr="list"></MyFooter>
  </div>
</template>

<script>
import MyHeader from "./components/MyHeader"
import MyFooter from "./components/MyFooter"
import MyGoods from "./components/MyGoods"
export default {
  data () {
    return {
      list:[]
    }
  },
    components: {
      MyHeader,
      MyFooter,
      MyGoods,
    },
    created () {
     this.$axios({
        url:"https://www.escook.cn/api/cart"
      }).then(res => {
        this.list = res.data.list
      })
    }
}
</script>

<style scoped>
 .main{
   padding: 45px 0 50px 0;
 }
</style>